package com.yumingjaing.listener;// UserQuerySuccessEventListener.java
import com.yumingjaing.cache.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class UserQuerySuccessEventListener {

    @EventListener
    public void handleUserQuerySuccessEvent(QueryUserSuccessEvent event) {
        User user = event.getUser();
        log.info("User query success. Name: {}",user.getName());
        // 注意：这里假设User类有getId()和getName()方法，实际中需要根据你的User类来调整
    }
}